import request from '@/utils/request'

// 查询出库任务详情
export function getOutWorkDetailInfo(id) {
  return request({
    url: `/ims_data/detail/getOutWorkDetailInfo/${id}`,
    method: 'get',
  })
}

// 查询出库任务列表
export function listImsStockOutWork(query) {
  return request({
    url: '/ims_data/imsStockOutWork/list',
    method: 'get',
    params: query,
  })
}

// 查询历史出库任务列表
export function listImsStockOutWorkHistory(query) {
  return request({
    url: '/ims_data/imsStockOutWorkHistory/list',
    method: 'get',
    params: query,
  })
}

// 查询历史出库任务详细
export function getImsStockOutWorkHistory(outWorkId) {
  return request({
    url: '/ims_data/imsStockOutWorkHistory/' + outWorkId,
    method: 'get',
  })
}

// 新增历史出库任务
export function addImsStockOutWorkHistory(data) {
  return request({
    url: '/ims_data/imsStockOutWorkHistory',
    method: 'post',
    data: data,
  })
}

// 修改历史出库任务
export function updateImsStockOutWorkHistory(data) {
  return request({
    url: '/ims_data/imsStockOutWorkHistory',
    method: 'put',
    data: data,
  })
}

// 删除历史出库任务
export function delImsStockOutWorkHistory(outWorkId) {
  return request({
    url: '/ims_data/imsStockOutWorkHistory/' + outWorkId,
    method: 'delete',
  })
}

// 强制终止
export function forcedTerminationOutWork(data) {
  return request({
    url: '/ims_data/imsStockOutWork/forcedTermination',
    method: 'post',
    data: data,
  })
}

// 任务完成
export function finishOutWork(data) {
  return request({
    url: '/ims_data/imsStockOutWork/finishOutWork',
    method: 'post',
    data: data,
  })
}

// 到位信号
export function inPlaceSignal(data) {
  return request({
    url: '/ims_data/imsStockOutWork/inPlaceSignal',
    method: 'post',
    data: data,
  })
}
